<template>
  <div>

    <el-row>
    <el-col :span="4" >
      <el-avatar :size='45' src="https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg"></el-avatar>
    </el-col>
    <el-col :span="15">
      <div>商店名称</div>
    </el-col>
    <el-col :span="5"><el-button plain size="mini" @click="save">收藏</el-button></el-col></el-row>
    <el-row :gutter="10">
      <el-col :span="6">
        <el-input placeholder="search"></el-input>
      </el-col>
      <el-col :span="18">
        <el-tabs v-model="tab" @tab-click="choose">
          <el-tab-pane label="点餐" name="first"></el-tab-pane>
          <el-tab-pane label="评价" name="second"> </el-tab-pane>
          <el-tab-pane label="商家" name="third"></el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
    <router-view></router-view>
  </div>
</template>

<script>
    export default {
        name: "Store",
        data(){
            return{
                tab:'first',
                path:'0'
            }
        },
        methods:{
            choose(tab){
                if(tab.index==='0'&& tab.index!==this.path) this.$router.replace('/store');
                else if(tab.index==='1'&& tab.index!==this.path) this.$router.replace('/store/comment');
                else if(tab.index!==this.path) this.$router.replace('/store/merchant');
                this.path = tab.index;
            },
            save(){

            }
        },
        created() {
            this.tab='first';
        }
    }
</script>

<style scoped>

</style>
